<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head th:replace="~{segmentation/_right_bottom_header::_header_common(~{::title},~{::link},~{::style})}">
    <meta charset="utf-8">
    <title>菜单列表</title>
    <link>
    <style type="text/css"></style>
</head>
<body>
<div class="layuimini-container" id="menuList" value="0">
    <div class="layui-row">
        <div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
            <div id="menuTreeId" class="demo-tree-more"></div>
        </div>
        <div class="layui-col-xs9 layui-col-sm9 layui-col-md9">
            <div class="layuimini-main">
                <fieldset class="layui-elem-field layuimini-search">
                    <legend>搜索信息</legend>
                    <div style="margin: 10px 10px 10px 10px">
                        <form class="layui-form" id="menu-search-form" action="">
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">开始时间</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="startTime" name="startTime" autocomplete="off"
                                               placeholder="请选择开始时间"
                                               class="layui-input startTime" readonly>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">结束时间</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="endTime" name="endTime" autocomplete="off"
                                               placeholder="请选择结束时间"
                                               class="layui-input endTime" readonly>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">菜单名称</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="name" autocomplete="off"
                                               placeholder="请输入菜单名称"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">菜单代码</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="code" autocomplete="off"
                                               placeholder="请输入菜单代码"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline"
                                     sec:authorize="hasPermission(#authorization.authentication,'menus','SYSTEM_MENU_LIST_MANAGEMENT')">
                                    <a class="layui-btn" lay-submit="" lay-filter="menu-search" title="搜搜">
                                        <i class="fa fa-search" aria-hidden="true"></i>
                                    </a>
                                </div>
                            </div>
                        </form>
                    </div>
                </fieldset>

                <div class="layui-btn-group" style="min-width: 100%;">
                    <a sec:authorize="hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:add')"
                       class="layui-btn menu-add" title="新增">
                        新增
                    </a>
<!--                    <a sec:authorize="hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:batchDel')"-->
<!--                       class="layui-btn layui-btn-danger menu-batch-del"-->
<!--                       style="margin-left: 10px!important;" title="批量删除">-->
<!--                        批量删除-->
<!--                    </a>-->
                </div>
                <table id="menuTableId" lay-filter="menuTableFilter"></table>
                <script type="text/html" id="menuCurrentTableBar">
                    <a sec:authorize="hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:view')"
                       class="layui-btn layui-btn-xs menu-view" value="{{d.id}}" lay-event="view" title="查看">
                        查看
                    </a>
                    <a sec:authorize="hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:edit')"
                       class="layui-btn layui-btn-xs menu-edit" value="{{d.id}}" lay-event="edit" title="编辑">
                        编辑
                    </a>
                    <a sec:authorize="hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:enable')"
                       class="layui-btn layui-btn-xs {{# if(d.enableStatus == 1){ }}layui-bg-orange{{# } else { }}layui-btn-normal{{# } }} menu-enable" value="{{d.id}}"
                       lay-event="enable" title="{{# if(d.enableStatus == 1){ }}禁用{{# } else { }}启用{{# } }}">
                        {{#  if(d.enableStatus == 1){ }}
                        禁用
                        {{#  } else { }}
                        启用
                        {{#  } }}
                    </a>
                    <a sec:authorize="hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:del')"
                       class="layui-btn layui-btn-xs layui-btn-danger menu-delete" value="{{d.id}}"
                       lay-event="delete" title="删除">
                        删除
                    </a>
                </script>

                <script type="text/html" id="enableStatusCurrentTableBar">
                    {{#  if(d.enableStatus == 1){ }}
                    <span style="color: limegreen;">是</span>
                    {{#  } else { }}
                    <span style="color: red;">否</span>
                    {{#  } }}
                </script>
                <script type="text/html" id="typeCurrentTableBar">
                    {{#  if(d.type == 9999){ }}
                    管理员菜单
                    {{#  } else if(d.type == 1){ }}
                    普通菜单
                    {{#  } }}
                </script>
                <script type="text/html" id="categoryCurrentTableBar">
                    {{#  if(d.category == 9999){ }}
                    菜单
                    {{#  } else if(d.category == 1){ }}
                    按钮
                    {{#  } }}
                </script>
                <script type="text/html" id="operaterStatusCurrentTableBar">
                    {{#  if(d.operaterStatus == 1){ }}
                    新增
                    {{#  } else { }}
                    修改
                    {{#  } }}
                </script>
            </div>
        </div>
    </div>
</div>
<div th:replace="~{segmentation/_tail::_tail_common}"></div>
<script th:inline="javascript">
    /*<![CDATA[*/
    [# sec:authorize = "hasPermission(#authorization.authentication,'menus','SYSTEM_MENU_LIST_MANAGEMENT')"]
    layui.use(['form', 'table', 'common', 'tree'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
            tree = layui.tree,
            laydate = layui.laydate,
            common = layui.common,
            startTime = {}, endTime = {},
            numView = 0, numEdit = 0, numDel = 0, numEnable = 0,
            treeSelectId = "",
            treeId = "menuTreeId",
            tableIdFilter = "menuTableFilter",
            tableId = "menuTableId";

        [# sec:authorize = "hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:add')"]
        // 新增操作
        $(document).off("click", ".menu-add");
        $(document).on("click", ".menu-add", function () {
            // var ids = common.getTableRowId(tableId, "id")
            // if (ids.length > 1) {
            //     // layer.alert('只能选中一个上级信息', {icon: 2});
            //     layer.msg('只能选中一个上级信息', {icon: 2});
            //     return;
            // }
            if (!treeSelectId || treeSelectId.length == 0) {
                layer.msg('请在树形中选择一个上级菜单!', {icon: 2});
                return;
            }
            var title = $(this).attr("title");
            var url = "/system/menu/get/add";
            var formId = "menuFormAddId";
            // if (ids.length == 0) {
            //     layer.confirm('如果不选中一行上级，当前新增为顶级菜单！', {
            //         icon: 3,
            //         title: '提示',
            //         shadeClose: true
            //     }, function (index) {
            //         layer.close(index);
            //         common.layer_show(title, url, null, null, formId, null, null, null, function () {
            //                 var queryData = common.getFormData($("#menu-search-form"));
            //                menuTreeRefresh({data: getTreeData()});
            //             menuTableRefresh(queryData);
            //         });
            //     });
            //     return;
            // }
            url += "?id=" + treeSelectId;
            common.layer_show(title, url, null, null, formId, null, null, null, function () {
                if ($("#menuList").attr('value') == 1) {
                    $("#menuList").attr('value', 0);
                    var queryData = common.getFormData($("#menu-search-form"));
                    menuTreeRefresh({data: getTreeData()});
                    menuTableRefresh(queryData);
                }
            });
        });
        [/]

        [# sec:authorize = "hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:view')"]
        numView = 1;
        function initView() {
            // 查看信息
            $(".layui-table").off("click", ".menu-view");
            $(".layui-table").on("click", ".menu-view", function () {
                var title = $(this).attr("title");
                var url = "/system/menu/get/view?id=" + $(this).attr("value");
                var formId = "menuFormViewId";
                common.layer_show(title, url, null, null, formId, null, null, null, function () {
                    // var queryData = common.getFormData($("#menu-search-form"));
                    // menuTableRefresh(queryData);
                });
            });
        }

        [/]

        [# sec:authorize = "hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:edit')"]
        numEdit = 1;
        function initEdit() {
            // 编辑操作
            $(".layui-table").off("click", ".menu-edit");
            $(".layui-table").on("click", ".menu-edit", function () {
                var title = $(this).attr("title");
                var url = "/system/menu/get/edit?id=" + $(this).attr("value");
                var formId = "menuFormEditId";
                common.layer_show(title, url, null, null, formId, null, null, null, function () {
                    if ($("#menuList").attr('value') == 1) {
                        $("#menuList").attr('value', 0);
                        var queryData = common.getFormData($("#menu-search-form"));
                        menuTreeRefresh({data: getTreeData()});
                        menuTableRefresh(queryData);
                    }
                });
            });
        }
        [/]

        [# sec:authorize="hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:enable')"]
        numEnable = 1;
        function initEnable() {
            // 启用、禁用信息
            $(".layui-table").off("click", ".menu-enable");
            $(".layui-table").on("click", ".menu-enable", function () {
                var id = $(this).attr("value");
                var title = $(this).attr("title");
                if (id.length == 0) {
                    layer.msg('请选中' + title + '信息');
                    return;
                }
                layer.confirm('确认' + title + '吗？', {
                    icon: 3,
                    title: '提示',
                    shadeClose: true
                }, function (index) {
                    layer.close(index);
                    $.ajax({
                        type: 'GET',
                        url: '/system/menu/enable',
                        data: {
                            id: id
                        },
                        dataType: 'json',
                        success: function (data) {
                            if (data.code == Result.SUCCESS) {
                                layer.msg('成功!', {
                                    icon: 1,
                                    shade: [0.3, '#f5f5f5'],
                                    time: 1500
                                }, function () {
                                    var queryData = common.getFormData($("#menu-search-form"));
                                    menuTableRefresh(queryData);
                                });
                            } else {
                                layer.msg(data.msg, {
                                    icon: 2,
                                    time: 3000
                                });
                            }
                        }, error: function (data) {
                            console.log(data);
                        },
                    });
                });
                return;
            });
        }
        [/]

        [# sec:authorize = "hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:del')"]
        numDel = 1;
        function initDel() {
            // 删除操作
            $(".layui-table").off("click", ".menu-delete");
            $(".layui-table").on("click", ".menu-delete", function () {
                // var ids = common.getTableRowId('menuTableId', "id")
                var id = $(this).attr("value");
                if (id.length == 0) {
                    layer.msg('请选中删除信息');
                    return;
                }
                layer.confirm('确认删除吗？', {
                    icon: 3,
                    title: '提示',
                    shadeClose: true
                }, function (index) {
                    layer.close(index);
                    $.ajax({
                        type: 'DELETE',
                        url: '/system/menu/del',
                        data: {
                            id: id
                        },
                        dataType: 'json',
                        success: function (data) {
                            if (data.code == Result.SUCCESS) {
                                layer.msg('成功!', {
                                    icon: 1,
                                    shade: [0.3, '#f5f5f5'],
                                    time: 1500
                                }, function () {
                                    var queryData = common.getFormData($("#menu-search-form"));
                                    menuTreeRefresh({data: getTreeData()});
                                    menuTableRefresh(queryData);
                                });
                            } else {
                                layer.msg(data.msg, {
                                    icon: 2,
                                    time: 3000
                                });
                            }
                        }
                        /* error:function(data) {
                            console.log(data.msg);
                        }, */
                    });
                });
                return;
            });
        }
        [/]

        [# sec:authorize = "hasPermission(#authorization.authentication,'button','SYSTEM_MENU_LIST_MANAGEMENT:batchDel')"]
        // // 批量删除操作
        // $(document).off("click", ".menu-batch-del");
        // $(document).on("click", ".menu-batch-del", function () {
        //     var ids = common.getTableRowId(tableId, "id");
        //     if (ids.length == 0) {
        //         layer.msg('请选中删除信息');
        //         return;
        //     }
        //     layer.confirm('确认删除吗？', {
        //         icon: 3,
        //         title: '提示',
        //         shadeClose: true
        //     }, function (index) {
        //         layer.close(index);
        //         $.ajax({
        //             type: 'POST',
        //             url: '/system/menu/batch/del',
        //             data: {
        //                 idList: ids
        //             },
        //             dataType: 'json',
        //             success: function (data) {
        //                 if (data.code == Result.SUCCESS) {
        //                     layer.msg('成功!', {
        //                         icon: 1,
        //                         shade: [0.3, '#f5f5f5'],
        //                         time: 1500
        //                     }, function () {
        //                         var queryData = common.getFormData($("#menu-search-form"));
        //                         menuTableRefresh(queryData);
        //                     });
        //                 } else {
        //                     layer.msg(data.msg, {
        //                         icon: 2,
        //                         time: 3000
        //                     });
        //                 }
        //             }
        //             /* error:function(data) {
        //                 console.log(data.msg);
        //             }, */
        //         });
        //     });
        //     return;
        // });
        [/]

        function getTreeData(id) {
            var data = [];
            $.ajax({
                url: "/system/menu/find/menu/tree/list",    //后台数据请求地址
                data: {id: id},        //id为加载当前角色的权限菜单，为角色id
                type: "post",
                async: false,
                success: function (resut) {
                    data = resut.data;
                }
            });
            return data;
        }

        //表格数据完成后初始化
        function tableInit(res, curr, count) {
            if (numView == 1) {
                initView();
            }
            if (numEdit == 1) {
                initEdit();
            }
            if (numEnable == 1) {
                initEnable();
            }
            if (numDel == 1) {
                initDel();
            }
            // common.initCheckbokOrRadio(tableId, 1);
        }

        //数据表格刷新事件
        function menuTableRefresh(data) {
            data.parentId = treeSelectId;
            table.reload(tableId, {
                page: {
                    page: 1
                },
                where: data
            });
        }

        //树形刷新事件
        function menuTreeRefresh(data) {
            treeSelectId = "";
            tree.reload(treeId, data);
        }

        //数据表格初始化
        var menuTableId = table.render({
            elem: '#' + tableId,
            id: tableId,
            url: '/system/menu/find/page/list',
            height: 'full-250',
            // contentType: 'application/json',
            // method: 'post',
            // even: true,
            done: tableInit,
            cols: [
                [
                    {type: "checkbox", width: 50, field: 'id', fixed: "left"},
                    {type: "numbers", width: 50, fixed: "left", title: '序号'},
                    {field: 'parentName', width: 120, title: '上级菜单', sort: true},
                    {field: 'name', width: 120, title: '菜单名称', sort: true},
                    {field: 'code', width: 300, title: '菜单代码', sort: true},
                    {field: 'type', width: 120, title: '类型', sort: true, templet: '#typeCurrentTableBar'},
                    {field: 'category', width: 120, title: '类别', sort: true, templet: '#categoryCurrentTableBar'},
                    {field: 'enableStatus', width: 80, title: '启用', sort: true, templet: '#enableStatusCurrentTableBar'},
                    {field: 'operaterStatus', width: 100, title: '状态', sort: true, templet: '#operaterStatusCurrentTableBar'},
                    {field: 'operaterTime', width: 160, title: '操作时间', sort: true},
                    {field: 'operaterUserName', width: 120, title: '操作人', sort: true},
                    {title: '操作', minWidth: 200, templet: '#menuCurrentTableBar', fixed: "right", align: "center"}
                ]
            ],
            // initSort: {
            //      sort: "createTime", //排序字段   在接口作为参数字段  field order
            //      order: "desc"
            // },
            sort: true,
            limits: [10, 25, 50, 100],
            limit: 10,
            page: true
        });

        //树形初始化
        tree.render({
            elem: '#' + treeId,
            id: treeId,
            data: getTreeData(),
            onlyIconControl: true,  //是否仅允许节点左侧图标控制展开收缩
            click: function (obj) {
                treeSelectId = obj.data.id;
                var queryData = common.getFormData($("#menu-search-form"));
                menuTableRefresh(queryData);
            }
        });

        // 行单击事件( 双击事件为: rowDouble )
        table.on('row(' + tableIdFilter + ')', function (obj) {
            // 标注当前点击行的选中状态
            obj.setRowChecked({
                type: 'checkbox' // radio 单选模式；checkbox 复选模式
            });
        });

        table.on('sort(' + tableIdFilter + ')', function (obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
            //尽管我们的 table 自带排序功能，但并没有请求服务端。
            //有些时候，你可能需要根据当前排序的字段，重新向服务端发送请求，从而实现服务端排序，如：
            var queryData = common.getFormData($("#menu-search-form"));
            queryData.sort = obj.field;//排序字段   在接口作为参数字段  field order
            queryData.order = obj.type;//排序方式   在接口作为参数字段  field order
            //请求参数（注意：这里面的参数可任意定义，并非下面固定的格式）
            menuTableRefresh(queryData);
        });
        // 监听搜索操作
        form.on('submit(menu-search)', function (data) {
            //执行搜索重载
            menuTableRefresh(data.field);
            return false;
        });

        startTime = laydate.render({
            elem: '#startTime',
            type: 'datetime',
            // min: -7, //7天前
            max: 'nowTime',//7天后
            btns: ['clear', 'confirm'],
            theme: 'grid',
            done: function (value, date, endDate) {
                common.setUpEndTime(endTime, value, date, 6);
            }
        });

        endTime = laydate.render({
            elem: '#endTime',
            type: 'datetime',
            max: 'nowTime',//7天后
            btns: ['clear', 'confirm'],
            theme: 'grid',
            ready: function (data) {
                var now = new Date();
                this.dateTime.hours = now.getHours();
                this.dateTime.minutes = now.getMinutes();
                this.dateTime.seconds = now.getSeconds();
            },
            done: function (value, date, endDate) {
                common.setUpStartTime(startTime, value, date, 6);
            }
        });

        // table.on('row("menuTableFilter")', function (obj) {
        //     //标注选中行样式
        //     obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click");
        //     /选中行，勾选复选框
        //     obj.tr.find("div.layui-unselect.layui-form-checkbox")[1].click();
        // });

        // table.on('row(menuTable)', function(obj){
        //     console.log("test:"+obj.tr) //得到当前行元素对象
        //     console.log("test:"+obj.data) //得到当前行数据
        //     //obj.del(); //删除当前行
        //     //obj.update(fields) //修改当前行数据
        // });
        // table.on('row(tabStudent)', function(obj){
        //     console.log("tabStudent:"+obj.tr) //得到当前行元素对象
        //     console.log("tabStudent:"+obj.data) //得到当前行数据
        //     //obj.del(); //删除当前行
        //     //obj.update(fields) //修改当前行数据
        // });

        // //多选禁止重复
        // $(document).off("click", ".layui-form-checkbox")
        // $(document).on("click", ".layui-form-checkbox", function (e) {
        // $(document).off("change", "[lay-filter='layTableAllChoose']")
        // $(document).on("click", ".layui-form-checkbox", function (e) {
        //     var thisTable = $("div[lay-id='" + tableId + "']");
        //     var thIsCheckbox = thisTable.find("th input[lay-filter='layTableAllChoose']").eq(0).is(':checked');
        //     if (thIsCheckbox) {
        //         var tdCheckboxs = thisTable.find("tr[data-index]");
        //         if (tdCheckboxs && tdCheckboxs.length > 0) {
        //             tdCheckboxs.each(function (i, item) {
        //                 $(item).addClass("select-checkbox-radio");
        //             })
        //         }
        //     } else {
        //         var tdCheckboxs = thisTable.find("tr[data-index]");
        //         if (tdCheckboxs && tdCheckboxs.length > 0) {
        //             tdCheckboxs.each(function (i, item) {
        //                 if (!$(item).find("input[name='layTableCheckbox']").is(":checked")) {
        //                     $(item).removeClass("select-checkbox-radio");
        //                 }
        //             })
        //         }
        //     }
        //     e.stopPropagation();
        // });


        // // //监听表格复选框选择
        // table.on('checkbox(menuTableFilter)', function (obj) {
        //     console.log(obj)
        // });

        // function getTableRowId(value) {
        //     var checkStatus = table.checkStatus('menuTableId')
        //         , data = checkStatus.data, arr = new Array();
        //     ;
        //     for (var i = 0; i < data.length; i++) {
        //         arr.push(data[i][value]);
        //     }
        //     return arr.join(",");
        // }

        // table.on('tool(menuTableFilter)', function (obj) {
        //     var data = obj.data;
        //     if (obj.event === 'edit') {
        //         var title = $(this).attr("title");
        //         var url = "/system/menu/get/edit?id=" + data.id;
        //         var formId = "menuFormEditId";
        //         common.layer_show(title, url, null, null, formId, null, null, null, function () {
        //             var queryData = common.getFormData($("#menu-search-form"));
        //             menuTableRefresh(queryData);
        //         });
        //     } else if (obj.event === 'delete') {
        //         console.log(getRowFexId('id'));
        //         layer.confirm('真的删除行么', function (index) {
        //             obj.del();
        //             layer.close(index);
        //         });
        //     }
        // });

        // $(document).off("click", "[lay-id='menuTableId'] .layui-table-body table.layui-table tbody tr")
        // $(document).on("click", "[lay-id='menuTableId'] .layui-table-body table.layui-table tbody tr", function (e) {
        //     // if ($(e.target).hasClass("layui-table-col-special") || $(e.target).parent().hasClass("layui-table-col-special")) {
        //     //     return false;
        //     // }
        //     //e.srcElement.tagName != "DIV" ||
        //     //background-color:#f2f2f2
        //     if (e.target.tagName != "DIV") {
        //         return;
        //     }
        //     var index = $(this).attr('data-index');
        //     var tableBox = $(this).closest('.layui-table-box');
        //     var tableFixed = tableBox.find(".layui-table-fixed.layui-table-fixed-l");
        //     var tableBody = tableBox.find(".layui-table-body.layui-table-main");
        //     var tableDiv = tableFixed.length > 0 ? tableFixed : tableBody;
        //     // checkCell.click();
        //     // tableDiv.find("tr[data-index=" + index + "]").addClass("select-checkbox");
        //     // $(this).find("tr[data-index="+index+"]").addClass("select-checkbox");
        //     var type = 1;
        //     if (type == 1) {//处理多选框
        //         var checkCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-checkbox div.layui-form-checkbox");
        //         if (checkCell.length) {
        //             checkCell.click();
        //             var is = checkCell.hasClass("layui-form-checked");
        //             var selectCheckboxOrRadio = $(this).parents("[lay-id='" + tableId + "']").find("tr[data-index=" + index + "]");
        //             //!is &&
        //             if (!selectCheckboxOrRadio.hasClass("select-checkbox-radio") && is) {
        //                 selectCheckboxOrRadio.addClass("select-checkbox-radio");
        //             } else if (selectCheckboxOrRadio.hasClass("select-checkbox-radio") && !is) {
        //                 selectCheckboxOrRadio.removeClass("select-checkbox-radio");
        //             }
        //         }
        //     } else if (type == 2) {//处理单选框
        //         var radioCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-radio div.layui-form-radio i");
        //         if (radioCell.length) {
        //             radioCell.click();
        //             var $this_table = $(this).parents("[lay-id='" + menuTableId + "']");
        //             $this_table.find("tr").removeClass("select-checkbox-radio");
        //             $this_table.find("tr[data-index=" + index + "]").addClass("select-checkbox-radio");
        //         }
        //     }
        //     // var index = $(this).attr('data-index')
        //     // var tableBox = $(this).closest('.layui-table-box');
        //     // var tableFixed = tableBox.find(".layui-table-fixed.layui-table-fixed-l");
        //     // var tableBody = tableBox.find(".layui-table-body.layui-table-main");
        //     // var tableDiv = tableFixed.length > 0 ? tableFixed : tableBody
        //     // var checkCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-checkbox div.layui-form-checkbox i");
        //     // // radioCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-radio div.layui-form-radio i");
        //     // // checkCell.click();
        //     // // tableDiv.find("tr[data-index=" + index + "]").addClass("select-checkbox");
        //     // // $(this).find("tr[data-index="+index+"]").addClass("select-checkbox");
        //     // console.log();
        //     // var selectCheckboxOrRadio = $(this).parent().parent().parent().parent().parent("[lay-id='menuTableId']").find("tr[data-index="+index+"]");
        //     //
        //     //
        //     // if (checkCell.length) {
        //     //     if(selectCheckboxOrRadio.hasClass("select-checkbox-radio")){
        //     //         selectCheckboxOrRadio.removeClass("select-checkbox-radio");
        //     //     }else{
        //     //         selectCheckboxOrRadio.addClass("select-checkbox-radio");
        //     //     }
        //     //     checkCell.click();
        //     // }
        //     // // if (radioCell.length) {
        //     // //     radioCell.click();
        //     // // }
        // });
        // //多选禁止重复
        // $(document).on("click", "td div.laytable-cell-checkbox div.layui-form-checkbox", function (e) {
        //     if (e.originalEvent) {
        //         e.stopPropagation();
        //     }
        //     // layui.stop(e);
        // });
        //单选禁止重复
        // $(document).on("click", "td div.laytable-cell-radio div.layui-form-radio", function (e) {
        //     e.stopPropagation();
        //     // layui.stop(e);
        // });
    });
    [/]
    /*]]>*/
</script>
</body>
</html>